/**
 * 
 */
package com.india.metro.bangalore;

import javax.xml.bind.annotation.XmlElement;

import com.india.RouteCode;
import com.india.StopNode;
import com.sangharsh.core.algo.location.Location;

/**
 * @author gautasa
 *
 */
public enum BangaloreMetroNode implements StopNode {
	
	MYSORE_RD(2000, "Mysore Road", -1, -1, false)
	,DEEPANJALI_NGR(2001,"Deepanjali Nagar", -1, -1, false)
	,VIJAYANAGAR(2002,"Vijayanagar", -1, -1, false)
	,HOSAHALLI(2003,"Hoshalli", -1, -1, false)
	,TOLL_GATE(2004,"Toll Gate", -1, -1, false)
	,MAGADI_RD(2004,"Magadi Road", -1, -1, false)
	,CITY_RLY_STATION(2005,"City Railway Station", -1, -1, false)
	,MAJESTIC(2006,"Majestic", -1, -1, false)
	,CENTRAL_COLLEGE(2003,"Central College", -1, -1, false)
	,VIDHAN_SOUDHA(2003,"Vidhan Soudha", -1, -1, false)
	,CRICKET_STADIUM(2003,"Cricket Stadium", -1, -1, false)
	,M_G_RD(2003,"M.G. Road", -1, -1, false)
	,TRINITY_CIRCLE(2003,"Trinity Circle", -1, -1, false)
	,ULSOOR(2003,"Ulsoor", -1, -1, false)
	,C_M_H_RD(2003,"C.M.H. Road", -1, -1, false)
	,INDIRANAGAR(2003,"Indiranagar", -1, -1, false)
	,OLD_MADRAS_RD(2003,"Old Madras Road", -1, -1, false)
	,B_HALL(2003,"B. Hall", -1, -1, false)
	
	,PUTTENAHALLI(2003,"Puttenahalli", -1, -1, false)
	,J_P_NAGAR(2003,"J.P. Nagar", -1, -1, false)
	,BANASHANKARI(2003,"Banashankari", -1, -1, false)
	,R_V_RD(2003,"R.V. Road", -1, -1, false)
	,JAYANAGAR(2003,"Jayanagar", -1, -1, false)
	,SOUTH_END_CIRCLE(2003,"South End Circle", -1, -1, false)
	,LALBAGH(2003,"Lalbagh", -1, -1, false)
	,K_R_RD(2003,"K.R. Road", -1, -1, false)
	,CITY_MARKET(2003,"City Market", -1, -1, false)
	,CHICKPET(2003,"Chickpet", -1, -1, false)
	,SWASTIK(2003,"Swastik", -1, -1, false)
	,MALLESWARAM(2003,"Malleswaram", -1, -1, false)
	,KUVEMPU_RD(2003,"Kuvempu Road", -1, -1, false)
	,RAJAJINAGAR(2003,"Rajajinagar", -1, -1, false)
	,MAHALAKSHMI_LAYOUT(2003,"Mahalakshmi Layout", -1, -1, false)
	,YESHWANTHPUR(2003,"Yeshwanthpur", -1, -1, false)
	,PLATINUM_CITY(2003,"Platinum City", -1, -1, false)
	,OUTER_RING_ROAD(2003,"Outer Ring Road", -1, -1, false)
	,PEENYA(2003,"Peenya", -1, -1, false)
	,PEENYA_IND_AREA(2003,"Peenya Industrial Area", -1, -1, false)
	,DASARAHALLI(2003,"Dasarahalli", -1, -1, false)
	,HESARAGHATTA_CROSS(2003,"Hesaraghatta Cross", -1, -1, false)
	;
	@XmlElement
	private int id;
	@XmlElement
	private String name;
	@XmlElement
	private double longitude;
	@XmlElement
	private double latitude;
	@XmlElement
	private boolean active;
	private RouteCode routeCode;
	BangaloreMetroNode(int id, String name, double latitude, double longitude, boolean active) {
		this.id = id;
		this.name = name;
		this.latitude = latitude;
		this.longitude = longitude;
		this.active = active;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public double getLongitude() {
		return longitude;
	}

	public double getLatitude() {
		return latitude;
	}

	public String getCode() {
		return this.toString();
	}

	public boolean isActive() {
		return active;
	}
	
	@Override
	public RouteCode getRouteCode() {
		return routeCode;
	}

	@Override
	public void setRouteCode(RouteCode routeCode) {
		this.routeCode = routeCode;
	}

	public static BangaloreMetroNode lookupById(int id){
		for(BangaloreMetroNode node : values()){
			if(node.getId() == id){
				return node;
			}
		}
		return null;
	}
	@Override
	public Location getLocation(){
		return Location.getLocation(this.latitude, this.longitude);
	}
}
